import 'package:wanxiang_app/generated/json/base/json_field.dart';
import 'package:wanxiang_app/generated/json/news_detail_entity.g.dart';
import 'dart:convert';
export 'package:wanxiang_app/generated/json/news_detail_entity.g.dart';

@JsonSerializable()
class NewsDetailEntity {
	late int code;
	late String msg;
	late NewsDetailData data;

	NewsDetailEntity();

	factory NewsDetailEntity.fromJson(Map<String, dynamic> json) => $NewsDetailEntityFromJson(json);

	Map<String, dynamic> toJson() => $NewsDetailEntityToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class NewsDetailData {
	late int id;
	late String title;
	late String content;
	late int type;
	@JSONField(name: "add_time")
	late String addTime;
	@JSONField(name: "update_time")
	late String updateTime;
	@JSONField(name: "sort_id")
	late int sortId;
	@JSONField(name: "look_num")
	late int lookNum;
	@JSONField(name: "user_name")
	late String userName;
	late String platform;
	@JSONField(name: "img_url")
	late String imgUrl;
	late String introduce;
	@JSONField(name: "previous_id")
	late int previousId;
	@JSONField(name: "previous_title")
	late String previousTitle;
	@JSONField(name: "next_id")
	late int nextId;
	@JSONField(name: "next_title")
	late String nextTitle;

	NewsDetailData();

	factory NewsDetailData.fromJson(Map<String, dynamic> json) => $NewsDetailDataFromJson(json);

	Map<String, dynamic> toJson() => $NewsDetailDataToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}